package com.learn.springboot.web;

import com.learn.springboot.web.vo.User;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dyz
 * @program learning
 * @create 2019-08-12 15:17
 */
@RestController
public class UserController {

    @PostMapping(value = "/user", consumes = MediaType.APPLICATION_XML_VALUE, produces = MediaType.APPLICATION_XML_VALUE)
    public User save(@RequestBody User user) {
        user.setName("dyz - " + user.getName());
        user.setAge(1 + user.getAge());
        return user;
    }
}
